package gtkwire.widget;

import gtkwire.*;
import gtkwire.widget.utils.GtkResizeMode;

/**
*Base class for widgets which contain other widgets.
*/
public abstract class GtkContainer extends GtkWidget
{
	protected GtkContainer()
        {
		super();
        }

        protected GtkContainer( String name, GladeKey key )
        {
		super( name, key );
        }

	/**
	*Adds widget to container. Typically used for simple containers such as GtkWindow,
	*GtkFrame, or GtkButton; for more complicated layout containers
	*such as *GtkBox or GtkTable, this function will pick default packing parameters that may not be correct.
	*/
	public void add( GtkWidget widget )
	{
		app().sendCommand( name, GTKWireCommand.ADD_WIDGET, widget.getName() );
	}

	/**
	*Removes widget from container and DESTROYS it.  Widget must be inside container.
	*/
	public void remove( GtkWidget widget )
	{
		app().sendCommand( name, GTKWireCommand.REMOVE_WIDGET, widget.getName() );
	}
	
	/**
	* Sets the border width of the container.
	*/
	public void setBorderWidth( int width )
	{
		app().sendCommand( name, GTKWireCommand.SET_BORDER, width );
	}
	
	/**
	*Sets the resize mode for the container.
	*/
	public void setResizeMode( GtkResizeMode mode )
	{
		app().sendCommand( name, GTKWireCommand.SET_RESIZABLE, mode.getMode() );
	}

}//end class
